package com.nuc.kl.module.basedata.service.impl;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.nuc.kl.base.DaoSupportImpl;
import com.nuc.kl.module.basedata.entity.Direction;
import com.nuc.kl.module.basedata.service.DirectionSerivce;

@Service
@Transactional
public class DirectionServiceImpl extends DaoSupportImpl<Direction> implements DirectionSerivce{

	public List<Direction> findBySQL(int start, int number, String findName) {
		
		return getSession().createQuery(//
				"FROM  Direction WHERE name LIKE '%" + findName + "%'")//
				.setFirstResult(start)//
				.setMaxResults(number)//
				.list();
	}

	public List<Direction> findAllDirection() {
		// TODO Auto-generated method stub
		return getSession().createQuery("from Direction").list();
	}

}
